// pages/user/message/reply/reply.js
const T = getApp().globalData.T
const config = getApp().globalData.config
let token = '';
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    token = getApp().globalData.token;
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    this.getList();
  },

  getList() {
    T.req({
      loadTitle: '加载中...',
      url: config.api + 'forum/topic/comment',
      method: 'GET',
      data: {
        token: token,
        userId: getApp().globalData.userId
      },
      success: (res) => {
        this.setData({
          reply: res
        })
      }
    })
  },
  onDetail(e) {
    let id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '/pages/find/detail/detail?id=' + id,
    })
  }

})